﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.Sales
{
    public class GeneralLedger : BusinessObject
    {
        public GeneralLedger()
        {
            AddRule(new ValidateRequired("RefID"));

            AddRule(new ValidateRequired("RefNo"));
            AddRule(new ValidateLength("RefNo", 0, 20));

            AddRule(new ValidateRequired("AccountingObjectID"));
        }

        public GeneralLedger(string generalLedgerId, string refId, string refDetailId, int refType, string refNo, DateTime refDate, DateTime postedDate,
                                string accountingObjectId, string descriptionMaster, string descriptionDetail, decimal amount, string currencyId, string restaurantId)
            : this()
        {
            GeneralLedgerID = generalLedgerId;
            RefID = refId;
            RefDetailID = refDetailId;
            RefType = refType;
            RefNo = refNo;
            RefDate = refDate;
            PostedDate = postedDate;
            AccountingObjectID = accountingObjectId;
            DescriptionMaster = descriptionMaster;
            DescriptionDetail = descriptionDetail;
            Amount = amount;
            CurrencyID = currencyId;
            RestaurantID = restaurantId;
        }

        public string GeneralLedgerID { get; set; }

        public string RefID { get; set; }

        public string RefDetailID { get; set; }

        public int RefType { get; set; }

        public string RefNo { get; set; }

        public string CurrencyID { get; set; }

        public DateTime RefDate { get; set; }

        public DateTime PostedDate { get; set; }

        public string AccountingObjectID { get; set; }

        public string DescriptionMaster { get; set; }

        public string DescriptionDetail { get; set; }

        public decimal Amount { get; set; }

        public string RestaurantID { get; set; }
    }
}
